#include "win_exception.h"

win_exception::win_exception(std::string m, DWORD er)
  : data_exception(m, er, er)
{
  LPSTR	lpMsgBuff;
	FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
				| FORMAT_MESSAGE_FROM_SYSTEM,
				NULL,
				this->data_,
				LANG_NEUTRAL,
				(LPTSTR)&lpMsgBuff,
				0,
				NULL);
  strncpy(msg, runtime_error::what(), MSG_SIZE);
  strncat(msg, lpMsgBuff, MSG_SIZE-strlen(msg));
}